package fair.service;

import fair.mapper.UserMapper;
import fair.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author fair_wu
 * @version v1.0
 * @date 2021-02-18 下午 12:26
 */

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    //根据id查询
    public User queryById(Long id){
        return userMapper.selectByPrimaryKey(id);
    }
    //新增用户
    public void addUser(User user){
        userMapper.insertSelective(user);
    }
}
